package com.intelligentpension.kotlinsimpleroom.dao

import androidx.room.*

/**
 * 版权：点赞 版权所有
 * author :赵航
 * @e-mail: zhaohangcn@gmail.com
 * time：2022/3/26
 * describe ：
 * 数据库的操作类,进行相关的操作
 */
@Dao
interface UserDao {
    @Insert
    fun insert(user: User);

    @Delete
    fun delete(user: User)

    @Delete
    fun reset(list: List<User>)

    @Update
    fun upDate(user: User)

    @Update
    fun upData(vararg user:User)

    @Query("UPDATE t_use set phone=:sText Where id=:sId")
    fun upData(sId: Long, sText: String)

    @Query("select * from t_use")
    fun selectAll():List<User>;

    @Query("select * from t_use where phone=:mId")
    fun findUserById(mId:String):User


}